{{ template "header.html" }}

<div class="item">
    WebToolsGo--Json格式化
</div>
<div class="item">
    <label>
        <textarea name="in">{"name": "GetcharZp", "age": 18}</textarea>
    </label>
</div>
<button onclick="jsonFormat()">格式化</button>

<div id="jsonAns" style="white-space: pre; background-color:#cccccc;"></div>

<script>
    function jsonFormat() {
        var i = $("textarea[name='in']").val()
        $.post("/json", {"in": i}, function (res) {
            $("#jsonAns").text(res.out)
        }, "json")
    }
</script>

{{ template "footer.html" }}